package com.fau.cm.entity;

import java.io.Serializable;
import java.math.BigDecimal;
import java.util.Date;

import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.GeneratedValue;
import javax.persistence.Id;
import javax.persistence.Table;
import javax.persistence.Transient;

import org.hibernate.annotations.GenericGenerator;
import org.json.simple.JSONAware;
import org.json.simple.JSONObject;

/**
 * @desc 话务业绩分析表实体类
 * @author kangyj
 * @datetime 2014年12月9日,上午1:22:15
 */
@Entity
@Table(name = "medical_call_perfor_analysis")
public class MedicalCallPerforAnalysis implements Serializable, JSONAware {

	private static final long serialVersionUID = 6528688994937141677L;

	private String id;
	private String adminId;		// 话务员id
	private String ordersId;	// 订单id
	private String adminJobNum;	// 工号
	private String adminName;	// 客服代表姓名
	private String groupId;		// 组id
	private String groupName;	// 组名
	private Integer userCount;	// 组人数
	private String centerId;	// 中心id
	private String centerName;	// 中心名称
	private Integer outgoingCount;		// 呼出数
	private Integer incomingCount;		// 呼入数
	private BigDecimal commodityMoney;	// 货款
	private BigDecimal tCommodityMoney;	// 总货款
	private BigDecimal freight;			// 运费
	private BigDecimal tFreight;		// 总运费
	private BigDecimal tMoney;			// 总金额
	private BigDecimal tTMoney;			// 总金额合计
	private Integer productQuantity;	// 产品数量
	private Integer tProductQuantity;	// 总产品数量
	private Integer ordersCount;		// 订单数
	private String hospitalId;			// 医院id
	private Date ordersTime;			// 创建时间（下单时间）
	private String startTime;			// 开始时间
	private String endTime;				// 截止时间
	private BigDecimal avgMoney;		// 平均金额
	
	private Date stime;
	private Date etime;
	
	@Id
	@GenericGenerator(name = "generator", strategy = "uuid.hex")
	@GeneratedValue(generator = "generator")
	@Column(name = "id", length = 32)
	public String getId() {
		return id;
	}

	public void setId(String id) {
		this.id = id;
	}

	@Column(name = "admin_id", length = 32)
	public String getAdminId() {
		return adminId;
	}

	public void setAdminId(String adminId) {
		this.adminId = adminId;
	}
	
	@Column(name = "orders_id", length = 32)
	public String getOrdersId() {
		return ordersId;
	}

	public void setOrdersId(String ordersId) {
		this.ordersId = ordersId;
	}

	@Transient
	public String getAdminJobNum() {
		return adminJobNum;
	}

	public void setAdminJobNum(String adminJobNum) {
		this.adminJobNum = adminJobNum;
	}

	@Transient
	public String getAdminName() {
		return adminName;
	}

	public void setAdminName(String adminName) {
		this.adminName = adminName;
	}

	@Column(name = "group_id", length = 32)
	public String getGroupId() {
		return groupId;
	}

	public void setGroupId(String groupId) {
		this.groupId = groupId;
	}
	
	@Transient
	public String getGroupName() {
		return groupName;
	}

	public void setGroupName(String groupName) {
		this.groupName = groupName;
	}
	
	@Transient
	public Integer getUserCount() {
		return userCount;
	}

	public void setUserCount(Integer userCount) {
		this.userCount = userCount;
	}
	
	@Column(name = "center_id", length = 32)
	public String getCenterId() {
		return centerId;
	}

	public void setCenterId(String centerId) {
		this.centerId = centerId;
	}
	
	@Transient
	public String getCenterName() {
		return centerName;
	}

	public void setCenterName(String centerName) {
		this.centerName = centerName;
	}

	@Transient
	public Integer getOutgoingCount() {
		return outgoingCount;
	}

	public void setOutgoingCount(Integer outgoingCount) {
		this.outgoingCount = outgoingCount;
	}

	@Transient
	public Integer getIncomingCount() {
		return incomingCount;
	}

	public void setIncomingCount(Integer incomingCount) {
		this.incomingCount = incomingCount;
	}

	@Column(name = "commodity_money", length = 11)
	public BigDecimal getCommodityMoney() {
		return commodityMoney;
	}

	public void setCommodityMoney(BigDecimal commodityMoney) {
		this.commodityMoney = commodityMoney;
	}
	
	@Transient
	public BigDecimal gettCommodityMoney() {
		return tCommodityMoney;
	}

	public void settCommodityMoney(BigDecimal tCommodityMoney) {
		this.tCommodityMoney = tCommodityMoney;
	}

	@Transient
	public BigDecimal gettFreight() {
		return tFreight;
	}

	public void settFreight(BigDecimal tFreight) {
		this.tFreight = tFreight;
	}

	@Transient
	public BigDecimal gettTMoney() {
		return tTMoney;
	}

	public void settTMoney(BigDecimal tTMoney) {
		this.tTMoney = tTMoney;
	}

	@Column(name = "freight", length = 11)
	public BigDecimal getFreight() {
		return freight;
	}

	public void setFreight(BigDecimal freight) {
		this.freight = freight;
	}
	
	@Column(name = "orders_time")
	public Date getOrdersTime() {
		return ordersTime;
	}

	public void setOrdersTime(Date ordersTime) {
		this.ordersTime = ordersTime;
	}

	@Column(name = "t_money", length = 11)
	public BigDecimal gettMoney() {
		return tMoney;
	}

	public void settMoney(BigDecimal tMoney) {
		this.tMoney = tMoney;
	}

	@Column(name = "product_quantity", length = 11)
	public Integer getProductQuantity() {
		return productQuantity;
	}

	public void setProductQuantity(Integer productQuantity) {
		this.productQuantity = productQuantity;
	}
	
	@Transient
	public Integer gettProductQuantity() {
		return tProductQuantity;
	}

	public void settProductQuantity(Integer tProductQuantity) {
		this.tProductQuantity = tProductQuantity;
	}

	@Transient
	public Integer getOrdersCount() {
		return ordersCount;
	}

	public void setOrdersCount(Integer ordersCount) {
		this.ordersCount = ordersCount;
	}

	@Column(name = "hospital_id", length = 32)
	public String getHospitalId() {
		return hospitalId;
	}

	public void setHospitalId(String hospitalId) {
		this.hospitalId = hospitalId;
	}
	
	@Transient
	public String getStartTime() {
		return startTime;
	}

	public void setStartTime(String startTime) {
		this.startTime = startTime;
	}

	@Transient
	public String getEndTime() {
		return endTime;
	}

	public void setEndTime(String endTime) {
		this.endTime = endTime;
	}
	
	@Transient
	public BigDecimal getAvgMoney() {
		return avgMoney;
	}

	public void setAvgMoney(BigDecimal avgMoney) {
		this.avgMoney = avgMoney;
	}
	
	@Transient
	public Date getStime() {
		return stime;
	}

	public void setStime(Date stime) {
		this.stime = stime;
	}

	@Transient
	public Date getEtime() {
		return etime;
	}

	public void setEtime(Date etime) {
		this.etime = etime;
	}

	@SuppressWarnings("unchecked")
	@Override
	public String toJSONString() {
		JSONObject obj = new JSONObject();
		obj.put("adminJobNum", adminJobNum);
		obj.put("adminName", adminName);
		obj.put("groupName", groupName);
		obj.put("incomingCount", incomingCount);
		obj.put("outgoingCount", outgoingCount);
		obj.put("ordersCount", ordersCount);
		obj.put("tCommodityMoney", tCommodityMoney);
		obj.put("tFreight", tFreight);
		obj.put("tTMoney", tTMoney);
		obj.put("tProductQuantity", tProductQuantity);
		obj.put("avgMoney", avgMoney);
		obj.put("userCount", userCount);
		obj.put("centerName", centerName);
		return obj.toString();
	}

}
